MECHWARRIOR 4 Map Creator

The map creator is a simple interface allowing you to run the Terrain Creation Tool (TCTd).  This will create all the necessary files needed to make a new terrain for MechWarrior 4:Vengeance.  When a map is created with this tool, it is written to the MechWarrior Vengeance\resource\maps directory, and then the Mission Editor can create a new mission using the newly created maps.

Before Using Map Creator
You will need to do the following steps.  All maps should be saved as a 24-bit .tga, unless otherwise stated.  The must be a power of 2 (16,32,64,128,256, etc) pixels, and square.  All references to dimensions are in pixels for this document.  Three files have been included with this documentation called:
Tutorial_colormap.tga
Tutorial_detailmap.tga
Tutorial_heightfield.tga
These 3 tga images can be used with the Map Creator to generate a simple 2x2 zone map.

Step 1: Generating Grayscale Height Maps
Generate a grayscale image for use with Map Creator.  The grayscale height map will be projected top down onto a grid to describe the elevation geometry of the current environment. Elevation is denoted by the color of the pixels. White pixels will correspond to the highest point on the map, where as black pixels will be the low point.  The grayscale height map can be generated using the application of your choice.  The resolution of the grayscale height map will be determined by the intended size in meters of the final terrain.  Equate 256 pixels per Zone and multiply the number of zones times that.

The relationship is as follows: 

Size		Ref	Grey scale	Result							
2kmap 	2x2	512x512	24bit .tga will generate a 2560x2560 meter grid	
3kmap 	3x3	768x768	24bit .tga will generate a 3840x3840 meter grid	
4kmap 	4x4	1024x1024	24bit .tga will generate a 5120x5120 meter grid	

The Only RGB color information that is calculated for the height filed map is the RED channel.  There is a feature in Map Creator, which allows you to specify areas in which more polygons should be assigned to improve detail, by altering the Green channel of the RGB height map.  Clear the channel completely of pixel formation, or just make it black.  Add white to those areas of interest or areas that will have high game play traffic.  This will give TCTD the option of shifting the poly count to the areas highlighted by the green channel if extra polys are available. 

The Edges of a terrain should be fairly flat. Extreme altitude along edges can cause rogue polygons that span across hilltops.

Step 2: Generating Color Maps
Generate a texture map for the current environment.  This map will be projected top down onto the terrain and will visually represent the type of terrain you are on, (such as grass, sand, or snow).  The color map can be generated using the application of your choice.  The resolution of the color map must be twice that of your grayscale height map.

The relationship is as follows: 

Size		Grey scale	Color 		
2kmap 	512x512	1024x1024	 
3kmap 	768x768	1536x1536	
4kmap 	1024x1024	2048x2048	

Step 3: Generating Detail Maps
Detail maps are generated to add a higher resolution to the terrain surrounding the player’s mech.  Detail maps are always 32bit .tga files that are tiled over the terrain.  They cannot be larger than 256x256.  Only one texture can be used per terrain.
The RGB channels of the detail map contain the texture information that will be blended with the terrain surrounding the player’s mech using the alpha channel to define the amount of influence different portions of the RGB channels will have.  White values in the alpha channel will allow a maximum contribution from the RGB channels.  While black would negate any contribution from the RGB channels, gray values would allow a certain percentage of influence.  Simply stated the black hides, the white shows.

Optional Step 4: Generating Water Maps
You can add water to your terrain.  It requires three maps, all of which have to be power of 2, square, tileable, .tga maps.  They cannot be larger than 256x256 pixels. If the detail texture has an alpha channel it will have to be in 32-bit format.

•	Water Texture – The water texture is a color map that will tile over the surface of the water.  It can be opaque or transparent based on the alpha channel of the detail texture.  
•	Water Detail – The water detail map will add a higher resolution to the water surface surrounding the mech. <similar to Step 3 above>
•	Under Water Detail – The under water detail map will add a higher resolution to the terrain, under the water surface, surrounding the mech. <similar to Step 3 above>

Using Map Creator
	Map Creator requires that the three maps from the above be supplied. The following is a description of the features available.

•	Map Name – Enter a name for the map, This the name that will appear in the editor for the terrain
•	Create Map – Runs TCTd and creates the text files needed for importing the map to the editor.

Geometry Tab
•	Height Field – Enter the pathway to the active height map (the gray scale map from Step 1 above).
•	Height Scale – This number represents meters per grayscale step
Ex. A pixel in the grayscale map with a value of 30 would be 15 meters high in the game. 30*0.5 = 15 Ex. An all white grayscale map would be an even 127.5 meters high in the game. 255 x 0.5 = 127.5.  The best range for this value is between 0-1
•	Poly Count – The number of polygons per zone you want in the terrain. 3000 is very high. The tool will get within 1% of the number specified.  For better performance you will want to use the minimum amount of polygons needed.
•	Smoothing Passes – A smoothing algorithm is applied to the map geometry.  Values of 1or 2 seem to work best.
•	Triangle Cap – This determines how the polygons (specified in Poly Count) will be distributed across the zone.  
o	None – This will let the TCTd determine the best way to distribute the polygons.  This is the quickest way of distributing, and may cause strange results in the terrain.
o	Local – This method will equally distribute the polygons over the 16 subsections of a zone. (Poly Count/16 per subsection)
o	Area – This method will distribute based on an area of 9 of the 16 subsections. Each area will have  (9* (Poly Count/16)) polygons to be distributed across that area.  This method allows for subsections that need more detail, by allowing a subsection in an area to have more polygons than the local amount (Poly Count/16).  This is the suggested setting.
•	Final Pass – Checking this will cause TCTd to do a much more in depth calculation of the terrain.  This will take considerably longer.  Leaving it unchecked will cause some anomalies in the terrain, but it is much faster and more than enough to do testing on.
•	Use Interest Data – Puts a higher concentration of polys in the area designated on the green channel of the of the height map. <refer Step 1 above>  This will determine a multiplier to the subsection polygon count created by the selected Triangle Cap method and the specified Poly Count.

Texture Tab
•	Terrain Texture – Enter pathway and filename for the .tga file <refer to Step 2>
•	Detail Texture – Enter pathway and filename for the detail file <refer to Step 3>
•	Detail Fade In – Distance that the Detail texture will be completely faded in and viewable by the player.
•	Detail Fade Out – Distance the Detail texture will be completely faded out.
•	Detail Ratio – # of times the detail texture will tile per zone.

Water Tab
•	Use Water – Check this if you want water on the map.
•	Water Level – Entering a value of 0-10 will place the water 0-10 meters above the lowest point on the height field.
•	Water Texture – Enter pathway and filename for the active water texture.
o	Ratio – Represents the number of times the texture will be tiled per zone.
•	Detail Texture – Enter pathway and filename for the active water detail texture.  The Detail texture should be saved out in 32 bit format.
o	Ratio – Represents the number of times the texture will be tiled per zone.
•	Underwater Texture – Enter pathway and filename for the active underwater detail texture.

Tips:
•	To avoid graphic priority issues and texture z-tearing with water/terrain edges, the ground terrain should meet the water edge at an approximate 45-degree angle.
•	Reiterate: The edges of the map should be leveled out as much as possible to reduce rogue polygons.
•	Since the water level is added onto the lowest point on your map, a random dark pixel on your height-map can alter desired water level.
•	Reiterate: In the RGB color information in the height image; the Red Channel is used for height, the Green Channel is used for Interest areas, and the Blue Channel is not used at all.
•	If for some reason the Map Creator fails while creating a Map, delete the folder and the incomplete file created, or problems will occur while trying to run the editor.